package view;

import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JTabbedPane;

public class TutorialView implements ITutorialView {

	private JTabbedPane frPrincipal;
	
	private static final long serialVersionUID = 8519491170788820563L;

	private JSplitPane BackPane;
	private TopicosView topicosView;
	private MaterialEstudoView materialEstudoView;
	
	private ActionListener listener;
	
	public TutorialView(JTabbedPane frPrincipal) {
		this.frPrincipal=frPrincipal;
	}
	
	public TutorialView(String nome,TopicosView topicosView, MaterialEstudoView materialEstudoView) {
		BackPane.setName(nome);
		this.topicosView=topicosView;
		this.materialEstudoView=materialEstudoView;		
	}

	
	private void buildGUI() {
		BackPane.setLeftComponent(topicosView.getPanel());
		BackPane.setRightComponent(materialEstudoView.getPanel());
		
	}

	@Override
	protected void refresh() {
		// TODO Auto-generated method stub
	}

	@Override
	public BuscaTutorialView getView() {
		// TODO Auto-generated method stub
		return this;
	}

	@Override
	public void hide() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setActionEventListener(ActionListener listener) {
		this.listener=listener;
		
	}

	@Override
	public void show() throws Exception {
		buildGUI();		
	}

	@Override
	public void showError(Exception e) {
		// TODO Auto-generated method stub
		
	}

	public TopicosView getTopicosView() {
		return topicosView;
	}

	public void setTopicosView(TopicosView topicosView) {
		this.topicosView = topicosView;
	}

	public MaterialEstudoView getMaterialEstudoView() {
		return materialEstudoView;
	}

	public void setMaterialEstudoView(MaterialEstudoView materialEstudoView) {
		this.materialEstudoView = materialEstudoView;
	}

}
